home *** CD-ROM | disk | FTP | other *** search
- onClipEvent(enterFrame){
- this._x += Xspeed;
- this._y += Yspeed;
- if(status == 1)
- {
- if(this._x > right || this._x < left)
- {
- Xspeed = - Xspeed;
- }
- if(this._y > bottom || this._y < top)
- {
- Yspeed = - Yspeed;
- }
- if(this.hittest("_root.goal"))
- {
- status = 2;
- _root.insert.nextFrame();
- }
- if(this.hittest("_root.sheep01"))
- {
- if(this._x < _root.sheep01._x && Xspeed > 0)
- {
- Xspeed = - Xspeed;
- }
- if(this._x > _root.sheep01._x && Xspeed < 0)
- {
- Xspeed = - Xspeed;
- }
- }
- if(this.hittest("_root.sheep02"))
- {
- if(this._x < _root.sheep02._x && Xspeed > 0)
- {
- Xspeed = - Xspeed;
- }
- if(this._x > _root.sheep02._x && Xspeed < 0)
- {
- Xspeed = - Xspeed;
- }
- }
- if(this.hittest("_root.sheep03"))
- {
- if(this._x < _root.sheep03._x && Xspeed > 0)
- {
- Xspeed = - Xspeed;
- }
- if(this._x > _root.sheep03._x && Xspeed < 0)
- {
- Xspeed = - Xspeed;
- }
- }
- if(this.hittest("_root.sheep04"))
- {
- if(this._x < _root.sheep04._x && Xspeed > 0)
- {
- Xspeed = - Xspeed;
- }
- if(this._x > _root.sheep04._x && Xspeed < 0)
- {
- Xspeed = - Xspeed;
- }
- }
- if(this.hittest("_root.sheep05"))
- {
- if(this._x < _root.sheep05._x && Xspeed > 0)
- {
- Xspeed = - Xspeed;
- }
- if(this._x > _root.sheep05._x && Xspeed < 0)
- {
- Xspeed = - Xspeed;
- }
- }
- if(this.hittest("_root.sheep06"))
- {
- if(this._x < _root.sheep06._x && Xspeed > 0)
- {
- Xspeed = - Xspeed;
- }
- if(this._x > _root.sheep06._x && Xspeed < 0)
- {
- Xspeed = - Xspeed;
- }
- }
- if(Xspeed > 0)
- {
- this.gotoAndStop("right");
- }
- else
- {
- this.gotoAndStop("left");
- }
- if(this._x > right)
- {
- this._x = _root.area._width - this._width / 2;
- }
- else if(this._x < 0 + this._width / 2)
- {
- this._x = 0 + this._width / 2;
- }
- else if(this._y > bottom)
- {
- this._y = _root.area._height - this._height / 2;
- }
- else if(this._y < 0 + this._height / 2)
- {
- this._y = 0 + this._height / 2;
- }
- }
- else if(status == 2)
- {
- this.gotoAndPlay("clear");
- _root.score -= 1;
- }
- else if(status == 3)
- {
- this._x = -30;
- this._y = -30;
- }
- }
-